package com.project.webpage.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.project.webpage.dto.*;
import com.project.webpage.mapper.CompanyDailyMapper;
import com.project.webpage.mapper.CompanyMonthlyMapper;
import com.project.webpage.service.CompanyOperationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CompanyOperationServiceImpl implements CompanyOperationService {

    @Resource
    private CompanyDailyMapper companyDailyMapper;
    @Resource
    private CompanyMonthlyMapper companyMonthlyMapper;

    @Override
    @DS("secondary")
    public List<CompanyDailyDto> getDailyListForPage(SearchByRqRangeParam param) {
        return companyDailyMapper.selectListByUid(param);
    }

    @Override
    @DS("secondary")
    public List<CompanyMonthlyDto> getMonthlyListForPage(SearchByMonthParam param) {
        return companyMonthlyMapper.selectListByUid(param);
    }

    @Override
    @DS("secondary")
    public List<CompanyMonthlyDto> getYearListForPage(SearchByYearParam param) {
        return companyMonthlyMapper.selectYearListByUid(param);
    }
}
